const struct xenbus_device_id *id)
{
int err;
- struct backend_info *be = kmalloc(sizeof(struct backend_info),
+ struct backend_info *be = kzalloc(sizeof(struct backend_info),
GFP_KERNEL);
if (!be) {
xenbus_dev_fatal(dev, -ENOMEM,
"allocating backend structure");
return -ENOMEM;
}
- memset(be, 0, sizeof(*be));
-
be->dev = dev;
dev->data = be;
return err;
}
- info = kmalloc(sizeof(*info), GFP_KERNEL);
+ info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info) {
xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure");
return -ENOMEM;
}
- memset(info, 0, sizeof(*info));
info->xbdev = dev;
info->vdevice = vdevice;
info->connected = BLKIF_STATE_DISCONNECTED;
{
struct xlbd_major_info *ptr;
- ptr = kmalloc(sizeof(struct xlbd_major_info), GFP_KERNEL);
+ ptr = kzalloc(sizeof(struct xlbd_major_info), GFP_KERNEL);
if (ptr == NULL)
return NULL;
- memset(ptr, 0, sizeof(struct xlbd_major_info));
-
ptr->major = major;
switch (index) {
char *frontend;
int err;
- be = kmalloc(sizeof(*be), GFP_KERNEL);
+ be = kzalloc(sizeof(*be), GFP_KERNEL);
if (!be) {
xenbus_dev_error(dev, -ENOMEM, "allocating backend structure");
return -ENOMEM;
}
- memset(be, 0, sizeof(*be));
frontend = NULL;
err = xenbus_gather(dev->nodename,
const struct xenbus_device_id *id)
{
int err;
- struct backend_info *be = kmalloc(sizeof(struct backend_info),
+ struct backend_info *be = kzalloc(sizeof(struct backend_info),
GFP_KERNEL);
if (!be) {
xenbus_dev_fatal(dev, -ENOMEM,
"allocating backend structure");
return -ENOMEM;
}
- memset(be, 0, sizeof(*be));
be->dev = dev;
dev->data = be;
const struct xenbus_device_id *id)
{
int err;
- struct backend_info *be = kmalloc(sizeof(struct backend_info),
+ struct backend_info *be = kzalloc(sizeof(struct backend_info),
GFP_KERNEL);
if (!be) {
return -ENOMEM;
}
- memset(be, 0, sizeof(*be));
-
be->is_instance_set = 0;
be->dev = dev;
dev->data = be;
nonseekable_open(inode, filp);
- u = kmalloc(sizeof(*u), GFP_KERNEL);
+ u = kzalloc(sizeof(*u), GFP_KERNEL);
if (u == NULL)
return -ENOMEM;
- memset(u, 0, sizeof(*u));
INIT_LIST_HEAD(&u->transactions);
init_waitqueue_head(&u->read_waitq);
}
stringlen = strlen(nodename) + 1 + strlen(type) + 1;
- xendev = kmalloc(sizeof(*xendev) + stringlen, GFP_KERNEL);
+ xendev = kzalloc(sizeof(*xendev) + stringlen, GFP_KERNEL);
if (!xendev)
return -ENOMEM;
- memset(xendev, 0, sizeof(*xendev));
/* Copy the strings into the extra space. */